import { EggAppConfig, PowerPartial } from 'egg';

export default () => {
  const config: PowerPartial<EggAppConfig> = {
    sequelize: {
      dialect: 'mysql',
      host: 'mysql',
      port: 3306,
      username: 'root',
      // 密码
      password: 'Lexiangmili1688',
      database: 'shop',
      define: {
        underscored: false,  // 禁止驼峰式字段默认转为下划线
        charset: 'utf8mb4',
        timestamps: true
      },
      dialectOptions: {
        charset: 'utf8mb4'
      },
    },
    redis: {
      client: {
        port: 6379, // Redis port
        host: 'server-redis', // Redis host
        password: '',
        db: 0,
      },
    },
  };
  return config;
};
